var p = document.querySelector("p");
var input = document.querySelector("input");
var flag = 0;
btn.onclick = function () {
  // p.innerHTML = input.value;
  flag++;
  if (flag % 2 == 1) {
    input.type = "password";
    //   if (input.value != "") {
    //     btn.innerHTML = "显示密码";
    //   }
    btn.innerHTML = "显示密码";
  } else {
    input.type = "text";
    //   if (input.value != "") {
    //     btn.innerHTML = "隐藏密码";
    //   }
    btn.innerHTML = "隐藏密码";
  }
};
var div_color = document.querySelector(".div_color");
var div_btn = document.querySelector(".div_btn");
div_btn.onclick = function () {
  var color_random =
    "rgb(" +
    Math.floor(Math.random() * 256) +
    "," +
    Math.floor(Math.random() * 256) +
    "," +
    Math.floor(Math.random() * 256) +
    ")";
  div_color.style.backgroundColor = color_random;
  console.log(color_random);
};
